home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / rjs.lha / RJS / String / tests / tcontains.C < prev    next >
C/C++ Source or Header  |  1991-06-14  |  507b  |  21 lines

  1. #include "test.h"
  2.  
  3. void Contains()
  4. {
  5.  
  6. String s1("This is a test");
  7. String s2("This"),s3("Thus");
  8. Assert(s1.contains('h'));        // char found
  9. Assert(s1.contains("is"));        // char * found
  10. Assert(s1.contains(s2));        // String found
  11. Assert(!s1.contains('H'));        // char not found
  12. Assert(!s1.contains("junk"));        // char * not found
  13. Assert(!s1.contains(s3));        // String not found
  14. s1="abcdsf 123 asfds";
  15. s2="sdfdsfdssdfg";
  16. Assert(s1.contains(SSint));        // Regex found
  17. Assert(!s2.contains(SSint));        // Regex not found
  18. }
  19.  
  20.  
  21.